﻿// 文件路径：AyuBookmark.Common/Interfaces/IUserRepository.cs
using System.Threading.Tasks;
using AyuBookmark.Common.Models;

namespace AyuBookmark.Common.Interfaces
{
    /// <summary>
    /// 用户仓储接口
    /// </summary>
    public interface IUserRepository
    {
        /// <summary>
        /// 根据ID获取用户
        /// </summary>
        Task<User> GetByIdAsync(int id);

        /// <summary>
        /// 添加新用户
        /// </summary>
        Task AddAsync(User user);

        /// <summary>
        /// 更新用户信息
        /// </summary>
        Task UpdateAsync(User user);

        /// <summary>
        /// 根据用户名获取用户
        /// </summary>
        Task<User> GetByUsernameAsync(string username);

        /// <summary>
        /// 根据邮箱获取用户
        /// </summary>
        Task<User> GetByEmailAsync(string email);

        /// <summary>
        /// 更新用户最后登录时间
        /// </summary>
        Task UpdateLastLoginTimeAsync(int userId);
    }
}